<!DOCTYPE html>
<html>
	{include file="public/header" /}

	<body>
		<div class="layui-fluid">
			<div class="layui-card">
				<div class="layui-card-body">
					<div style="padding-bottom: 10px;">
					</div>
					<table id="LAY-user-manage" lay-filter="LAY-user-manage"></table>
					<script type="text/html" id="imgTpl">
						<img style="display: inline-block; width: 50%; height: 100%;" src={ { d.avatar }}>
					</script>
				</div>
			</div>
		</div>
		{include file="public/footer" /}
		<script>
			layui.use(['index', 'table', 'form', 'laydate'], function() {
				var form = layui.form;
				form.render('checkbox');
				form.on('switch(isValid)', function(data) {

					changState(data.value, data.elem.checked);
				});
				form.on('switch(isTraining)', function(data) {
					alert(22);
					changState1(data.value, data.elem.checked);
				});
				var $ = layui.$,
					form = layui.form,
					table = layui.table;
				table.render({
					elem: '#LAY-user-manage',
					url: "{:url('admin/count/qudao_danziss')}?times=" + "{$times}",
					
					toolbar: '#test-table-toolbar-toolbarDemo',
					title: '用户数据表',
					cols: [
								[{
										type: 'numbers',
										title: '排序',
										width: 40,

										rowspan: 2,
										fixed: 'left',
										unresize: true,
									},
									{
										field: 'times',
										title: '日期',
										width: 110,
										rowspan: 2,
									},
									{
										field: 'Name',
										title: '渠道名称',
										width: 110,
										rowspan: 2,
									},
									{
										field: 'yinghuan_count',
										title: '应还单数',
										width: 90,
										rowspan: 2,

									},
									{
										field: 'shiji_cont',
										title: '实还单数',
										width: 90,
										rowspan: 2,
									},
									{
										field: 'weihuan_count',
										title: '未还单数',
										width: 90,
										rowspan: 2,

									},
									{
										field: 'huankuanlv',

										title: "<span lay-tips='实还单数/应还单数'>还款率</span>",
										width: 80,
										rowspan: 2,

									},
									{
										field: 'quaner_count',
										title: '全额单数',
										width: 90,
										rowspan: 2,

									}, {
										field: 'xuqi_count',
										title: '展期单数',
										width: 90,
										rowspan: 2,

									},
									{
										field: 'quankuanlv',

										title: "<span lay-tips='全额单数/应还单数'>全额率</span>",
										width: 80,
										rowspan: 2,

									},
									{
										field: 'xuqilv',

										title: "<span lay-tips='展期单数/应还单数'>展期率</span>",
										width: 80,
										rowspan: 2,

									}

									, {
										align: 'center1',
										title: "<p style='text-align:center' lay-tips='新客数据'>新客</p>",
										colspan: 4
									}, {
										align: 'center2',
										title: "<p style='text-align:center' lay-tips='老客数据'>老客</p>",
										colspan: 4
									}
								],
								[{
										field: 'xinke_yinghuan_count',
										title: '应还单数',
										width: 90,

									},
									{
										field: 'xinke_shiji_cont',
										title: '已还单数',
										width: 90,

									},
									{
										field: 'xinke_huankuanlv',

										title: "<span lay-tips='还款单数/应还单数'>还款率</span>",
										width: 100,

									},
									{
										field: 'xinke_weihuan_count',
										title: '未还单数',
										width: 90,

									},

									{
										field: 'laoke_yinghuan_count',
										title: '应还单数',
										width: 90,

									},
									{
										field: 'laoke_shiji_cont',
										title: '已还单数',
										width: 90,

									},
									{
										field: 'laoke_huankuanlv',

										title: "<span lay-tips='还款单数/应还单数'>还款率</span>",
										width: 100,

									},

									{
										field: 'laoke_weihuan_count',
										title: '未还单数',
										width: 90,

									},

								]

							],
					page: true
				});

				//监听工具条
				table.on('tool(LAY-user-manage)', function(obj) {
					var data = obj.data;
					if(obj.event === 'detail') {}
				});
				//监听搜索
				form.on('submit(LAY-user-front-search)', function(data) {
					var field = data.field;

					//执行重载
					table.reload('LAY-user-manage', {
						where: field
					});
				});

				//事件
				var active = {};

				$('.layui-btn.layuiadmin-btn-useradmin').on('click', function() {
					var type = $(this).data('type');
					active[type] ? active[type].call(this) : '';
				});

				var laydate = layui.laydate;

				//常规用法
				laydate.render({
					elem: '#test1'
				});

				//国际版
				laydate.render({
					elem: '#test1-1',
					lang: 'en'
				});

				//年选择器
				laydate.render({
					elem: '#test2',
					type: 'year'
				});

				//年月选择器
				laydate.render({
					elem: '#test3',
					type: 'month'
				});

				//时间选择器
				laydate.render({
					elem: '#test4',
					type: 'time'
				});

				//日期时间选择器
				laydate.render({
					elem: '#test5',
					type: 'datetime'
				});

				//日期范围
				laydate.render({
					elem: '#test6',
					range: true
				});

				//年范围
				laydate.render({
					elem: '#test7',
					type: 'year',
					range: true
				});

				//年月范围
				laydate.render({
					elem: '#test8',
					type: 'month',
					range: true
				});

				//时间范围
				laydate.render({
					elem: '#test9',
					type: 'time',
					range: true
				});

				//日期时间范围
				laydate.render({
					elem: '#test10',
					type: 'datetime',
					range: true
				});

				//自定义格式
				laydate.render({
					elem: '#test11',
					format: 'yyyy年MM月dd日'
				});
				laydate.render({
					elem: '#test12',
					format: 'dd/MM/yyyy'
				});
				laydate.render({
					elem: '#test13',
					format: 'yyyyMMdd'
				});
				laydate.render({
					elem: '#test14',
					type: 'time',
					format: 'H点m分'
				});
				laydate.render({
					elem: '#test15',
					type: 'month',
					range: '~',
					format: 'yyyy-MM'
				});
				laydate.render({
					elem: '#test16',
					type: 'datetime',
					range: '到',
					format: 'yyyy年M月d日H时m分s秒'
				});

				//开启公历节日
				laydate.render({
					elem: '#test17',
					calendar: true
				});

				//自定义重要日
				laydate.render({
					elem: '#test18',
					mark: {
						'0-10-14': '生日',
						'0-12-31': '跨年' //每年的日期
							,
						'0-0-10': '工资' //每月某天
							,
						'0-0-15': '月中',
						'2017-8-15': '' //如果为空字符，则默认显示数字+徽章
							,
						'2099-10-14': '呵呵'
					},
					done: function(value, date) {
						if(date.year === 2017 && date.month === 8 && date.date === 15) { //点击2017年8月15日，弹出提示语
							layer.msg('这一天是：中国人民抗日战争胜利72周年');
						}
					}
				});

				//限定可选日期
				var ins22 = laydate.render({
					elem: '#test-limit1',
					min: '2016-10-14',
					max: '2080-10-14',
					ready: function() {
						ins22.hint('日期可选值设定在 <br> 2016-10-14 到 2080-10-14');
					}
				});

				//前后若干天可选，这里以7天为例
				laydate.render({
					elem: '#test-limit2',
					min: -7,
					max: 7
				});

				//限定可选时间
				laydate.render({
					elem: '#test-limit3',
					type: 'time',
					min: '09:30:00',
					max: '17:30:00',
					btns: ['clear', 'confirm']
				});

				//同时绑定多个
				lay('.test-item').each(function() {
					laydate.render({
						elem: this,
						trigger: 'click'
					});
				});

				//初始赋值
				laydate.render({
					elem: '#test19',
					value: '1989-10-14',
					isInitValue: true
				});

				//选中后的回调
				laydate.render({
					elem: '#test20',
					done: function(value, date) {
						layer.alert('你选择的日期是：' + value + '<br>获得的对象是' + JSON.stringify(date));
					}
				});

				//日期切换的回调
				laydate.render({
					elem: '#test21',
					change: function(value, date) {
						layer.msg('你选择的日期是：' + value + '<br><br>获得的对象是' + JSON.stringify(date));
					}
				});
				//不出现底部栏
				laydate.render({
					elem: '#test22',
					showBottom: false
				});

				//只出现确定按钮
				laydate.render({
					elem: '#test23',
					btns: ['confirm']
				});

				//自定义事件
				laydate.render({
					elem: '#test24',
					trigger: 'mousedown'
				});

				//点我触发
				laydate.render({
					elem: '#test25',
					eventElem: '#test25-1',
					trigger: 'click'
				});

				//双击我触发
				lay('#test26-1').on('dblclick', function() {
					laydate.render({
						elem: '#test26',
						show: true,
						closeStop: '#test26-1'
					});
				});

				//日期只读
				laydate.render({
					elem: '#test27',
					trigger: 'click'
				});

				//非input元素
				laydate.render({
					elem: '#test28'
				});

				//墨绿主题
				laydate.render({
					elem: '#test29',
					theme: 'molv'
				});
				//墨绿主题
				laydate.render({
					elem: '#test29two',
					theme: 'molv'
				});

				//自定义颜色
				laydate.render({
					elem: '#test30',
					theme: '#393D49'
				});

				//格子主题
				laydate.render({
					elem: '#test31',
					theme: 'grid'
				});

				//直接嵌套显示
				laydate.render({
					elem: '#test-n1',
					position: 'static'
				});
				laydate.render({
					elem: '#test-n2',
					position: 'static',
					lang: 'en'
				});
				laydate.render({
					elem: '#test-n3',
					type: 'month',
					position: 'static'
				});
				laydate.render({
					elem: '#test-n4',
					type: 'time',
					position: 'static'
				});
			});
		</script>
	</body>

</html>